package com.bigkoo.pickerviewdemo.bean;

import com.bigkoo.pickerview.model.IPickerViewData;

import java.util.List;

/**
 * TODO<json数据源>
 *
 * @author: 小嵩
 * @date: 2017/3/16 15:36
 */

public class JsonBean  implements IPickerViewData{


    /**
     * name : 省份
     * city : [{"name":"北京市","area":["东城区","西城区","崇文区","宣武区","朝阳区"]}]
     */
    private int Region;//我的变量
    private String name;
    private List<CityBean> city;

    public JsonBean(String name, int region) {
        this.name = name;
        Region = region;
    }

    public List<CityBean> getCity() {
        return city;
    }

    public void setCity(List<CityBean> city) {
        this.city = city;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getRegion() {
        return Region;
    }

    public void setRegion(int region) {
        Region = region;
    }

    // 实现 IPickerViewData 接口，
    // 这个用来显示在PickerView上面的字符串，
    // PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
    @Override
    public String getPickerViewText() {
        return this.name;
    }



    public static class CityBean {
        /**
         * name : 城市
         * area : ["东城区","西城区","崇文区","昌平区"]
         */

        private String name;
        private List<String> area;//
        private List<CountyBean> county;
        private int region;

        public CityBean(String name, int region) {
            this.name = name;
            this.region = region;
        }

        public int getRegion() {
            return region;
        }

        public void setRegion(int region) {
            this.region = region;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<String> getArea() {
            return area;
        }

        public List<CountyBean> getCounty() {
            return county;
        }

        public void setCounty(List<CountyBean> county) {
            this.county = county;
        }

        public void setArea(List<String> area) {
            this.area = area;
        }
        public static class CountyBean {
            /**
             * name : 兴庆区
             * RegionId : 640104
             * Town : [{"name":"凤凰北街街道办事处","RegionId":"640104001","Village":[{"name":"崇安社区居委会","RegionId":"640104001002"},{"name":"兴隆社区居委会","RegionId":"640104001003"},{"name":"北安社区居委会","RegionId":"640104001005"},{"name":"安秀社区居委会","RegionId":"640104001007"},{"name":"阳澄社区居委会","RegionId":"640104001008"}]},{"name":"解放西街街道办事处","RegionId":"640104002"}]
             */

            private String name;
            private int RegionId;

            public CountyBean(String name, int regionId) {
                this.name = name;
                RegionId = regionId;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getRegionId() {
                return RegionId;
            }

            public void setRegionId(int regionId) {
                RegionId = regionId;
            }
        }
    }
}
